package com.googlecode.transmutant.samples

import com.googlecode.transmutant.In 
import com.googlecode.transmutant.Step 
import com.googlecode.transmutant.Out 
import com.googlecode.transmutant.Stepper;

class MathSample {
	public static void main(String[] args) {
		def steps = [new Step1(), new Step2()]
		new Stepper().step(steps)
	}
}

class Step1 {
	
	@Out(name="number1")
	def number1 = 1
	@Out(name="number2")
	def number2 = 2
	
	@Out(name="number3") @Step Integer number3() {
		return 3
	}
}

class Step2 {
	
	@In(name="number1")
	def number1
	@In(name="number2")
	def number2
	
	@Step void number3(@In(name="number3") number3) {
		println "Number 1: ${number1}"
		println "Number 2: ${number2}"
		println "Number 3: ${number3}"
		println "Sum: ${number1 + number2 + number3}"
	}
}
